package com.lggry.extend4feature;

public class Test2 {
    public static void main(String[] args) {
        //目标：继承后子类的访问特点：就近原则
        Son son = new Son();
        son.grandChild();
    }
}

class Father{
    String name = "李熙胤";
}

class Son extends Father{
    String name = "李熙胤的儿子";

    public void grandChild(){
        String name = "李熙胤的孙子";
        System.out.println(name);
        System.out.println(this.name);
        System.out.println(super.name); //Father.name (super表示访问父类的...)
    }
}
